home *** CD-ROM | disk | FTP | other *** search
/ fxPAINT 1.0 / fxPAINT 1.0.iso / developers / plugins / includes / fxpaint / fxplugin.h < prev   
Encoding:
C/C++ Source or Header  |  1999-09-13  |  16.2 KB  |  391 lines

  1. /*
  2.         fxPLUGINs Header-file
  3.         ©1999 by Felix Schwarz. All rights reserved.
  4. */
  5.  
  6. #ifndef _FXPLUGIN_H
  7. #define _FXPLUGIN_H 1
  8.  
  9. #define MODE_DRAG 0L
  10. #define MODE_DRAW 1L
  11.  
  12. struct PluginInfo
  13. {
  14.         /* Version stuff*/
  15.         LONG  int_version;   /* Versionnumber of the plugin */
  16.         LONG  int_revision;  /* Revision of the plugin */
  17.         LONG  fxp_version;   /* Versionnumber of the used fxPAINT Plugin-SDK */
  18.  
  19.         /* Name and copyright stuff */
  20.         UBYTE *plugin_name;        /* Name of your plugin */
  21.         UBYTE *filter_name;        /* Name of the contained filter (if contained :) */
  22.         UBYTE *saver_name;         /* Name of the contained format the saver creates, if one is contained */
  23.         UBYTE *plugin_description; /* Description for the plugin */
  24.         UBYTE *author_name;        /* Your name */
  25.         UBYTE *author_company;     /* Name of your company */
  26.         UBYTE *author_copyright;   /* Name of your company */
  27.         UBYTE *logo_file;          /* Your logo-image in fxPAINT:Plugins/Logo/ */
  28.         UBYTE *help_file;          /* The help-file/docu for your plugin */
  29.  
  30.         /* Plugin-descriptor */
  31.         ULONG plugin_kind;  /* Kind of plugin */
  32.         ULONG plugin_flags; /* Flags */
  33.  
  34.         APTR  plugin_space; /* Pointer to memory needed by your plugin.
  35.                                If you don`t need additional memory, set this to
  36.                                NULL */
  37. };
  38.  
  39. struct PluginInit
  40. {
  41.         /* GUI Functions needed for graphic plugins */
  42.         struct Gadget * (* gui_crflexgad) (struct Gadget **glistptr, long winid, long x, long y, long border, long wid, ... );
  43.         struct Window * (* gui_openfix) (char *title, ULONG idcmp, long id, long x, long y, long addwid, long addhei);
  44.         void (* gui_drboxsel)   (long id, long x, long y, long w, long h);
  45.         ULONG blank; /* This field for future usage .. */
  46.  
  47.         /* Gfx Output funcs */
  48.         BOOL (* fxp_drawfsb)       (struct Window *win, struct Screen *scr, struct fsbitmap *fsb, long xpos, long ypos);
  49.         BOOL (* fxp_drawscaledfsb) (struct Window *win, struct Screen *scr, struct fsbitmap *fsb, long xpos, long ypos, long wid, long hei);
  50.         BOOL (* fxp_drawfitfsb)    (struct Window *win, struct Screen *scr, struct fsbitmap *fsb, long xpos, long ypos, long wid, long hei);
  51.  
  52.         /* An important pointer for YOU :) */
  53.         APTR plugin_space;
  54.  
  55.         /* The rest of the API resides here */
  56.         ULONG (* fxpaint_api) (long mode, ULONG attr, ULONG value, ULONG value2, ULONG value3, ULONG value4);
  57.  
  58.         ULONG pluginid;        /* ID to use with add & remove port ..*/
  59. };
  60.  
  61. struct PluginFilter
  62. {
  63.         struct PluginInit *pli; /* As for FXPlug_InitPlugin       */
  64.         APTR PluginData;        /* pointer to your allocated data */
  65.         struct fsbitmap *fsb;   /* Source and destination fsb     */
  66.         long fx_x;              /* X and Y coordinates in "positioningmode" */
  67.         long fx_y;
  68. };
  69.  
  70. struct PluginGUI
  71. {
  72.         struct PluginInit *pli; /* As for FXPlug_InitPlugin       */
  73.         APTR fxp_gui;           /* pointer to the fx_gui          */
  74.         long yourwin;           /* the ID of your window          */
  75.         APTR PluginData;        /* pointer to your allocated data */
  76.         long gui_ghei;          /* Height of single image         */
  77.         long gui_gsep;          /* Vertical Distance between gads */
  78.         BOOL realtime;          /* Is the realtime-mode activated ?
  79.                                    If yes, you should perform an fx_recalc
  80.                                    after every change of the settings.
  81.                                 */
  82.         long posimode;          /* Positioningmode ? (== e.g. for dragging
  83.                                    around a lightsource, etc.. the coordinates
  84.                                    are then contained in fx_x and fx_y of PluginFilter.
  85.                                    You can change this setting in this structure between
  86.                                    MODE_DRAG and MODE_DRAW
  87.                                 */
  88.         struct IntuiMessage *imsg; /* Message in a bottle ... :) */
  89. };
  90.  
  91. struct PluginIdent
  92. {
  93.         struct PluginInit *pli; /* As for FXPlug_InitPlugin */
  94.         APTR header_data;       /* Pointer to already loaded data from the
  95.                                    beginning of the file */
  96.         ULONG header_length;    /* Number of bytes at header_data */
  97.         UBYTE *file_name;       /* The name of the file to identify
  98.                                    Please use header_data to identify an
  99.                                    image, whereever possible and don`t
  100.                                    open the file, if it isn`t needed. */
  101. };
  102.  
  103. struct PluginImageInfo
  104. {
  105.         BOOL identified;        /* Is this image readable by your plugin ? */
  106.         BOOL size_identified;   /* Could you already get image width and height
  107.                                    out of the passed header ? */
  108.         ULONG width;            /* If yes, put the image`s dimensions here! */
  109.         ULONG height;
  110. };
  111.  
  112. struct PluginLoadImage
  113. {
  114.         struct PluginInit *pli; /* As for FXPlug_InitPlugin */
  115.         UBYTE *file_name;       /* Filename of the image to load */
  116. };
  117.  
  118. struct PluginSaveImage
  119. {
  120.         struct PluginInit *pli; /* As for FXPlug_InitPlugin */
  121.         struct fsbitmap *fsb;   /* Image data to save */
  122.         UBYTE *file_name;       /* Filename to save the image as! */
  123.         APTR fxp_gui;           /* Pointer to a valid FXGUI-structure for
  124.                                    all the saver-options (if there are any!)
  125.                                 */
  126. };
  127.  
  128. struct PluginHandlePorts
  129. {
  130.         struct PluginInit *pli; /* As for FXPlug_InitPlugin */
  131. };
  132.  
  133.  
  134. struct PluginBye
  135. {
  136.         struct PluginInit *pli;
  137.         APTR allocatedmem;
  138. };
  139.  
  140. struct PluginLaunch
  141. {
  142.         struct PluginInit *pli;
  143. };
  144.  
  145. struct fx_rectangle
  146. {
  147.         long x1;
  148.         long y1;
  149.         long x2;
  150.         long y2;
  151. };
  152.  
  153. struct fx_bevelbox
  154. {
  155.         long x1;
  156.         long y1;
  157.         long x2;
  158.         long y2;
  159.         long fbev;
  160.         long tbev;
  161.         long meth;
  162.         long kind;
  163. };
  164.  
  165. struct PluginReg
  166. {
  167.         struct PluginInit *pli;
  168.         long rclass;
  169.         long reg;
  170.         long content;
  171.         long reserved;
  172.         APTR PluginData;
  173. };
  174.  
  175. /* Some classes tags */
  176. #define CL_USER TAG_USER
  177. #define CL_TOGGABLE  (TAG_USER +  1)
  178. #define CL_TOGGLED   (TAG_USER +  2)
  179. #define CL_SAFETY    (TAG_USER +  3)
  180. #define CL_MAX       (TAG_USER +  4)
  181. #define CL_MIN       (TAG_USER +  5)
  182. #define CL_LV_FORMAT (TAG_USER +  6)
  183. #define CL_LV        (TAG_USER +  7)
  184. #define CL_DIGITS    (TAG_USER +  8)
  185. #define CL_COLSPACE  (TAG_USER +  9)
  186. #define CL_MESSAGEP  (TAG_USER + 10)
  187. #define CL_GAUGEPOS  (TAG_USER + 11)
  188. #define CL_TEXTWIDTH (TAG_USER + 12)
  189. #define CL_TEXT      (TAG_USER + 13)
  190. #define CL_LABELS    (TAG_USER + 14)
  191. #define CL_ENTRY     (TAG_USER + 15)
  192. #define CL_SORTED    (TAG_USER + 16)
  193. #define CL_POP_STATICFSB (TAG_USER + 17)
  194. #define CL_POP_VERT      (TAG_USER + 18)
  195. #define CL_POP_NUMLABEL  (TAG_USER + 19)
  196. #define CL_POP_CHLABEL   (TAG_USER + 20)
  197. #define CL_POP_LABELFSB  (TAG_USER + 21)
  198. #define CL_HELPTXT   (TAG_USER + 22)
  199. #define CL_HELPID    (TAG_USER + 23)
  200. #define CL_IMAGE     (TAG_USER + 24)
  201.  
  202. /* Accepted values for "Kind" */
  203. #define PLG_FILTER                 1L
  204. #define PLG_LOADER                 2L
  205. #define PLG_SAVER                  4L
  206. #define PLG_LAUNCHABLE             8L
  207. #define PLG_HAVEPORTS             16L
  208. #define PLG_DISPLAYDRIVER         32L
  209. #define PLG_MENULAUNCHABLE        64L
  210.  
  211. /* Accepted flags for "Flags" */
  212. #define PLG_FLG_LAUNCHMEATSTART   1L
  213.  
  214. /* Method-Types */
  215. #define FX_METHOD_GET     1L
  216. #define FX_METHOD_SET     2L
  217. #define FX_METHOD_PERFORM 3L
  218. #define FX_METHOD_DRAW    4L
  219.  
  220. /* Set & Get submethods */
  221. #define FX_ACTIVE_WIN              1L /* SET-Syntax: ok=(active)
  222.                                          GET-Syntax: active=()         */
  223.  
  224. #define FX_WIN_MAXNUMBER           2L /* GET-Syntax: maxnumber=()      */
  225.  
  226. #define FX_WIN_EXISTANCE           3L /* GET-Syntax: exists=(winid)    */
  227.  
  228. #define FX_WIN_NUMBEROFLAYERS      4L /* GET-Syntax: nol=(windid)      */
  229.  
  230. #define FX_WIN_LAYER               5L /* GET-Syntax: fsb=(winid,layer) */
  231.  
  232. #define FX_WIN_BG_IMAGE            6L /* GET-Syntax: fsb=(winid,layer) */
  233.  
  234. #define FX_WIN_FG_IMAGE            7L /* GET-Syntax: fsb=(winid,layer) */
  235.  
  236. #define FX_WIN_FILENAME            8L /* SET-Syntax: ok=(newname)
  237.                                          GET-Syntax: name=(winid)      */
  238.  
  239. #define FX_WIN_ICONIFIED           9L /* SET-Syntax: (newstatus)
  240.                                          GET-Syntax: status=(winid)    */
  241.  
  242. #define FX_WIN_RGB                10L /* SET-Syntax: (win, (r<<24|g<<16|b<<8))
  243.                                          GET-Syntax: r<<24|g<<16|b<<8=(winid)*/
  244.  
  245. #define FX_WIN_ACTIVEPEN_ID       11L /* SET-Syntax: ok=(newpenid)
  246.                                          GET-Syntax: penid=(winid)     */
  247.  
  248. #define FX_PEN_ID_EXISTANCE       12L /* GET-Syntax: exist=(penid)     */
  249.  
  250. #define FX_PEN_MAX_ID             13L /* GET-Syntax: maxpens=()        */
  251.  
  252. #define FX_PEN_ID_COVER           14L /* GET-Syntax: coverfsb=(penid)  */
  253.  
  254. #define FX_PEN_ID_NAME            15L /* SET-Syntax: ok=(penid,name)
  255.                                          GET-Syntax: name=(penid)      */
  256.  
  257. #define FX_PEN_ID_FRAMES          16L /* GET-Syntax: frames=(penid)    */
  258.  
  259. #define FX_PEN_ID_FRAME_FSB       17L /* GET-Syntax: framefsb=(penid,frame) */
  260.  
  261. #define FX_PALETTE_MAX            18L /* GET-Syntax: max=()            */
  262.  
  263. #define FX_PALETTE_SELENTRY       19L /* SET-Syntax: (winid, selentry)
  264.                                          GET-Syntax: selentry=()       */
  265.  
  266. #define FX_PALETTE_ENTRYRGB       20L /* SET-Syntax: ok=(entry,(r<<24|g<<16|b<<8)
  267.                                          GET-Syntax: r<<24|g<<16|b<<8=(entry)      */
  268.  
  269. #define FX_GUI_SLIDER             21L /* SET-Syntax: (win,gid,value)
  270.                                          GET-Syntax: value=(window, gid) */
  271.  
  272. #define FX_GUI_CHECKBOX           22L /* SET-Syntax: (win,gid,value)
  273.                                          GET-Syntax: value=(window, gid) */
  274.  
  275. #define FX_GUI_MY_FX_WIN_ID       23L /* GET-Syntax: value=()          */
  276. #define FX_GUI_BUTTON_CLASS_PTR   24L /* GET-Syntax: classptr=()       */
  277. #define FX_GUI_IMAGE_CLASS_PTR    25L /* GET-Syntax: classptr=()       */
  278. #define FX_GUI_SLIDER_CLASS_PTR   26L /* GET-Syntax: classptr=()       */
  279. #define FX_GUI_CHECKBOX_CLASS_PTR 27L /* GET-Syntax: classptr=()       */
  280. #define FX_GUI_GAUGE_CLASS_PTR    28L /* GET-Syntax: classptr=()       */
  281. #define FX_GUI_CYCLE_CLASS_PTR    29L /* GET-Syntax: classptr=()       */
  282. #define FX_GUI_POPUP_CLASS_PTR    30L /* GET-Syntax: classptr=()       */
  283.  
  284. #define FX_GUI_SEL_GRAD           31L /* SET-Syntax: (newgradfsb)
  285.                                          GET-Syntax: selgradfsb=()     */
  286.  
  287. #define FX_GUI_USEL_GRAD          32L /* SET-Syntax: (newgradfsb)
  288.                                          GET-Syntax: uselgradfsb=()    */
  289.  
  290. #define FX_GUI_SCREEN             33L /* GET-Syntax: screen=()         */
  291.  
  292. #define FX_GUI_VISUALINFO         34L /* GET-Syntax: visualinfo=()            */
  293.  
  294. #define FX_GUI_DRAWINFO           35L /* GET-Syntax: drawinfo=()              */
  295.  
  296. #define FX_GAUGE_PROGRESS         36L /* SET-Syntax: (newgaugevalue)*/
  297.  
  298. #define FX_GAUGE_PROGRESSTEXT     37L /* SET-Syntax: (newgaugetext) */
  299.  
  300. #define FX_WIN_POSITION           38L /* SET-Syntax: (winid, newx, newy)
  301.                                          GET-Syntax: (winid, &x, &y)          */
  302.  
  303. #define FX_GUI_GHEI               39L /* GET-Syntax: gadgethei=()             */
  304.  
  305. #define FX_WIN_EFFECT             40L /* SET-Syntax: (winid, effectid)
  306.                                          GET-Syntax: effectid = (winid,layer)   */
  307.  
  308. #define FX_WIN_TYPE               41L /* SET-Syntax: (winid, newtype, layer)
  309.                                          GET-Syntax: type   = (winid,layer)   */
  310.  
  311. #define FX_WIN_DRAWMETHOD         42L /* SET-Syntax: (winid, newmethod, layer)
  312.                                          GET-Syntax: method = (winid,layer)   */
  313.  
  314. #define FX_WIN_ALPHA              43L /* SET-Syntax: (winid, alphawin)
  315.                                          GET-Syntax: alphawin = (winid)       */
  316.  
  317. #define FX_WIN_ALPHAACTIVE        44L /* SET-Syntax: (winid, alphaactive)
  318.                                          GET-Syntax: alphaactive = (winid)    */
  319.  
  320. #define FX_PLUGIN_EFFECTID        45L /* GET-Syntax: pluginid = (plugin-name) */
  321.  
  322. #define FX_PLUGIN_EFFECTCONVERT   46L /* GET-Syntax: effectid = (group,effect)*/
  323.  
  324. #define FX_WIN_MSGPORT            47L /* GET-Syntax: msgport  = ()            */
  325.  
  326. #define FX_WIN_WINDOWSTRUCT       48L /* GET-Syntax: window   = (winid)       */
  327.  
  328. #define FX_WIN_PENPRESSURE        49L /* SET-Syntax: (newpressure)
  329.                                          GET-Syntax: pressure = ()                        */
  330.  
  331. #define FX_WIN_EFFECTREGISTER     50L /* SET-Syntax: (winid, register, value)             */
  332.  
  333. #define FX_ALBUM_ENTRIES          51L /* GET-Syntax: entries  = ()            */
  334.  
  335. #define FX_ALBUM_FILENAME         52L /* GET-Syntax: name     = (entry)       */
  336.  
  337. #define FX_ALBUM_THUMBNAIL        53L /* GET-Syntax: thumbfsb = (entry)       */
  338.  
  339. #define FX_WB_SCREEN              54L /* GET-Syntax: screen   = ()            */
  340.  
  341. #define FX_GUI_DISTX              55L /* GET-Syntax: distx    = ()            */
  342.  
  343. #define FX_GUI_DISTY              56L /* GET-Syntax: disty    = ()            */
  344.  
  345. #define FX_IO_PCD_ENABLED         57L /* Don`t use this one!! For internal use ONLY!      */
  346.  
  347. /* Performable submethods */
  348. #define FX_PLUGIN_ADDPORT          1L /* Syntax: (sigbits, pluginid)   */
  349. #define FX_PLUGIN_REMPORT          2L /* Syntax: (sigbits, pluginid)   */
  350. #define FX_PLUGIN_LOADPIC          3L /* Syntax: picfsb=(filename)     */
  351. #define FX_PLUGIN_FXRECALC         4L /* Syntax: ()                    */
  352. #define FX_PLUGIN_GUI_CLOSENFREE   5L /* Syntax: (window)              */
  353. #define FX_PLUGIN_FIND_STR_IN_BUF  6L /* Syntax: BOOL=(buf,buflen,str) */
  354. #define FX_PLUGIN_FSALLOCBITMAP    7L /* Syntax: fsb=(wid,hei,type), type=3 -> 24Bit-bitmap */
  355. #define FX_PLUGIN_FSFREEBITMAP     8L /* Syntax: (fsb)                 */
  356. #define FX_PLUGIN_CSTALLOCVEC      9L /* Syntax: ptr=(size,flags)      */
  357. #define FX_PLUGIN_CSTFREEVEC      10L /* Syntax: (ptr)                 */
  358. #define FX_FSLIB_DITHERTO256      11L /* Syntax: retfsb=(fsb,palette)  */
  359. #define FX_FSLIB_SCALECOPY        12L /* Syntax: retfsb=(fsb,newwid,newhei */
  360. #define FX_DEBUG_WRITETEXT        13L /* Syntax: (text)                */
  361. #define FX_WIN_ZOOM_PLUS          14L /* Syntax: (winid)               */
  362. #define FX_WIN_ZOOM_MINUS         15L /* Syntax: (winid)               */
  363. #define FX_WIN_GETZOOM            16L /* Syntax: zoom=(winid)          */
  364. #define FX_WIN_REFRESH            17L /* Syntax: (winid)               */
  365. #define FX_WIN_MERGE              18L /* Syntax: fsb=(x1,y1,x2,y2)     */
  366. #define FX_DEBUG_WRITETEXTNUMBER  19L /* Syntax: (text,number)         */
  367. #define FX_WIN_FROMFSB            20L /* Syntax: newwinid=(fromfsb)    */
  368. #define FX_PLUGIN_SAVEPIC         21L /* Syntax: (name,fsb,format,opts) */
  369. #define FX_FSLIB_CLONEBITMAP      22L /* Syntax: cloned=(fsb)           */
  370. #define FX_FSLIB_DITHERTO256FAST  23L /* Syntax: retfsb=(fsb,plaette)   */
  371. #define FX_ALBUM_ADDFILE          24L /* Syntax: (dir)                  */
  372. #define FX_ALBUM_ADDDIR           25L /* Syntax: (file)                 */
  373. #define FX_CONV_ADDSOURCE         26L /* Syntax: (soure)                */
  374. #define FX_LOADPICASNEWPROJECT    27L /* Syntax: (file)                 */
  375. #define FX_HELP_SHOWGUIDE         28L /* Syntax: (guide,node)           */
  376. #define FX_ASL_FILEREQUESTER      29L /* Syntax: file=(file,title)      */
  377.  
  378. /* Draw methods */
  379. #define FX_DRAW_DOT             1L /* (winid, x, y, method) */
  380. #define FX_DRAW_BOX             2L /* (winid, struct fx_rectangle*, method) */
  381. #define FX_DRAW_ELLIPSE         3L /* (winid, struct fx_rectangle*, method) */
  382. #define FX_DRAW_LINE            4L /* (winid, struct fx_rectangle*, method) */
  383. #define FX_DRAW_FILLEDBOX       5L /* (winid, struct fx_rectangle*, method) */
  384. #define FX_DRAW_FILLEDELLIPSE   6L /* (winid, struct fx_rectangle*, method) */
  385. #define FX_DRAW_FLOODFILL       7L /* (winid, x, y, method)                 */
  386. #define FX_DRAW_BEVELBOX        8L /* (winid, struct fx_bevelbox*, method)  */
  387. #define FX_DRAW_CUT             9L /* (winid, struct fx_rectangle*)         */
  388. #define FX_DRAW_SMEARLINE      10L /* (winid, struct fx_rectangle*, method) */
  389.  
  390. #endif
  391.